/*******************************************************************************
 * Copyright (C) 2013 Jeremy Brodt and Kevin Gillespie
 * Description: IMU I2C Interface
 *         $Id: imu_i2c.h 5 2013-12-18 04:48:03Z brodtj1212@gmail.com $
 *******************************************************************************
 */

#ifndef _IMU_I2C_H_
#define _IMU_I2C_H_

/***** Includes *****/

#include "maxq_config.h"

/***** Functions *****/

int8_t readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data);
int8_t readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data);
int8_t readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t *data);
int8_t readBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t *data);
int8_t readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data);
int8_t readWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data);
int8_t readBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data);
int8_t readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data);

int writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data);
int writeBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data);
int writeBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t data);
int writeBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t data);
int writeByte(uint8_t devAddr, uint8_t regAddr, uint8_t data);
int writeWord(uint8_t devAddr, uint8_t regAddr, uint16_t data);
int writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data);
int writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data);

#endif /* _IMU_I2C_H_ */
